package com.example.spring_blog.pojo.response;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
public class BlogInfoResponse {
    private Integer id;
    private String title;
    private String content;
    private Integer userId;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

//    // 后端对内容进行截断处理后再发给前端，防止占用带宽，考虑性能
//    public String getContent() {
//        return content == null ? "" : content.substring(0, 50);
//    }
}
